<!-- 组件通信视图：props/emit/总线/插槽 -->
<template>
  <div>
    <h2>组件通信示例</h2>
    <ChildA :msg="parentMsg" @reply="onReply">
      <template v-slot:default>默认插槽内容</template>
    </ChildA>
    <ChildB />
    <p>来自子组件的回复：{{ reply }}</p>
  </div>
</template>

<script>
import ChildA from '../components/comm/ChildA.vue'
import ChildB from '../components/comm/ChildB.vue'
export default {
  name: 'CommDemoPage',
  components: { ChildA, ChildB },
  data() { return { parentMsg: '来自父组件的消息', reply: '' } },
  methods: { onReply(v) { this.reply = v } }
}
</script>

